{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Getting started with Jupyter"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Before getting into the code, what is Jupyter, why are we using it, and why python?\n",
    "\n",
    "Jupyter comes in three parts: a kernel, a webserver, and the notebook app. All code run will be sent to and run on the kernel. The web server will handle sending code & results between the kernel and the notebook. Last, but most importantly for us, the notebook app delivers the results of code executed on the server, allows for easy sharing of code, and a unified environment among **serveral** other things. For those of you who are interested, you can read more about what Juptyer is and the impact it's making [here from Project Jupyter](https://jupyter.org), [here from nature](https://www.nature.com/news/interactive-notebooks-sharing-the-code-1.16261), [here from O'Reilly](https://www.oreilly.com/ideas/what-is-jupyter), and [here from the Jupyter documentation](https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html). Note, Jupyter Notebooks **do not exclusively** run Python code.\n",
    "\n",
    "Unlike Jupyter, Python has been around for decades, but has grown in popularity [recently](https://bit.ly/2u1z6gh). As a result, several projects are being developed in python first and the python has a strong open source culture. \n",
    "\n",
    "Let's get into writing code. Most importantly, how do I execute code in a Jupyter notebook? (Ctrl + Enter)\n",
    "\n",
    "Let's try some simple operations. Each code input section below, e.g. [1], is referred to as a \"cell\"."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = 3\n",
    "b = 4\n",
    "a + b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a / b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a // b"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice there aren't any types that are defined like some other languages. We can see what type each object is hy simply calling `type` on it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(type(a))\n",
    "print(type(b))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "c = a / b\n",
    "type(c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = \"some string\"\n",
    "type(a)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can easily redefine `a` and run this cell again."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = 15\n",
    "# a has been reset to 15\n",
    "a + b"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
